{include file = "styles/header.tpl"}

<div id="content" class="box">
	<h1>Priviledge Management</h1>
	
	<br />	
 <form method="post" name="index"   onsubmit="return showProgressBar();">
    <input type="submit" value="Save" name="save" class="bt" />
	<br />
	<br />
	<table width="100%">
		<tr>
		    <th>Id</th>
			<th>Group</th>
			<th>Function</th>
			<th>Admin</th>
			<th>Inventory</th>
			<th>Marketing</th>
			<th>Buying</th>
		</tr>
		{section name=i loop=$arrResult}
		  <tr {if $smarty.section.i.index%2!=0}class="bg"{/if}>
		    <td>{$arrResult[i].id}</td>
			<td>
				{assign var=group_id value=`$arrResult[i].group`}
				{$arrayGroup.$group_id}
			</td>
			<td>
				{assign var=function_id value=`$arrResult[i].function`}
				{$arrayFunc.$function_id}
			</td>
			<td align="center">
					<input type="checkbox" name="admin_{$arrResult[i].id}" 
					{if $arrResult[i].admin ==1 }checked="checked" {/if}/>
			</td>
			<td align="center">	
					<input type="checkbox" name="inventory_{$arrResult[i].id}"
					{if $arrResult[i].inventory ==1 }checked="checked" {/if} />
			</td>
			<td align="center">	
					<input type="checkbox" name="marketing_{$arrResult[i].id}" 
					{if $arrResult[i].marketing ==1 }checked="checked" {/if}/>
			</td>
			<td align="center">
			     	<input type="checkbox" name="buying_{$arrResult[i].id}"
					{if $arrResult[i].buying ==1 }checked="checked" {/if} />
			</td>
		 </tr>
		{/section}
	</table>
 </form>
</div>
{literal}
<script type="text/javascript">
	function showProgressBar()
	{
		showWaiting();
		return true;
	}
	
	function submit_done()
	{
		window.location.reload();
	}
</script>
{/literal}
<div id="currenttab" class="category_priviledge_mamagement" style="display: none;">
{include file = "styles/footer.tpl"}